package com.neutch.entity;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

public class User implements Serializable {
    private Integer id;
    private String name;
    private String password;
    private String phone;
    private String adress;
    private Timestamp creatTime;
    private Timestamp updateTime;
    /*当前用户状态*/
    private int status;

    public User(Integer id, String name, String password, String phone, String adress, Timestamp creatTime, Timestamp updateTime, int status) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.phone = phone;
        this.adress = adress;
        this.creatTime = creatTime;
        this.updateTime = updateTime;
        this.status = status;
    }

    public User() {
    }

    public User(String name, String password, String phone, String adress) {
        this.name = name;
        this.password = password;
        this.phone = phone;
        this.adress = adress;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public Timestamp getCreatTime() {
        return creatTime;
    }

    public void setCreatTime(Timestamp creatTime) {
        this.creatTime = creatTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return status == user.status &&
                id.equals(user.id) &&
                name.equals(user.name) &&
                password.equals(user.password) &&
                phone.equals(user.phone) &&
                adress.equals(user.adress) &&
                creatTime.equals(user.creatTime) &&
                updateTime.equals(user.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, password, phone, adress, creatTime, updateTime, status);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", adress='" + adress + '\'' +
                ", creatTime=" + creatTime +
                ", updateTime=" + updateTime +
                ", status=" + status +
                '}';
    }

}
